package org.jeecg.modules.pacs.handle;


public class RequestUtil {

    public static Request success(ResultEnum resultEnum, Object object) {
        Request request = new Request();
        request.setErrorCode(resultEnum.getErrorCode());
        request.setErrorMsg(resultEnum.getErrorMsg());
        request.setSuccess(resultEnum.getSuccess());
        request.setContent(object);
        return request;
    }

    public static Object success(Object object) {
        return object;
    }

    public static Request lose(Integer integer, String message, boolean success) {
        Request request = new Request();
        request.setErrorCode(integer);
        request.setErrorMsg(message);
        request.setSuccess(success);
        return request;
    }

    public static Request lose(ResultEnum resultEnum) {
        Request request = new Request();
        request.setErrorCode(resultEnum.getErrorCode());
        request.setErrorMsg(resultEnum.getErrorMsg());
        request.setSuccess(resultEnum.getSuccess());
        return request;
    }

}
